package com.solution.framework.util;

import java.util.HashMap;
import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 * Busline: sunguangzhu
 * Date: 13-7-1
 * Time: 上午11:04
 * To change this template use File | Settings | File Templates.
 */
public class ResultDto<T> {
    private String message;
    private boolean success = true;
    private T rows;
    private int total;
    private Map<Object, Object> map = new HashMap<Object, Object>();

    public ResultDto() {
    }

    public ResultDto(T rows, int total ) {
        this.rows = rows;
        this.total = total;
        this.success = true;
    }

    public ResultDto(T rows, int total,boolean success ) {
        this.rows = rows;
        this.total = total;
        this.success = success;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public T getRows() {
        return rows;
    }

    public void setRows(T rows) {
        this.rows = rows;
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public Map<Object, Object> getMap() {
        return map;
    }

    public void setMap(Map<Object, Object> map) {
        this.map = map;
    }

    public String toString() {
        return com.solution.framework.util.JsonUtil.transformObjectToString(this);
    }
}
